home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / ATLK / TN.ATLK.009 < prev   
Encoding:
Text File  |  1991-01-11  |  5.5 KB  |  116 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. AppleTalk
  8. #9:    The PAP Status Buffer
  9.  
  10. Written by:    Jim Luther                                       November 1990
  11.  
  12. This Technical Note shows the format of the status data returned into the
  13. application-supplied status buffer by the PAPStatus and PAPOpen Printer Access
  14. Protocol (PAP) AppleTalk commands.  The status buffer format is shown for both
  15. LaserWriter and ImageWriter (with the ImageWriter II/LQ LocalTalk Option card
  16. installed) printers.
  17. _____________________________________________________________________________
  18.  
  19. The PAPStatus and PAPOpen AppleTalk commands must supply a pointer to a 260-byte
  20. status buffer.  When the PAPStatus or PAPOpen commands complete, the status
  21. buffer contains the ATP data portion of a Status (TResp) packet.  The first four
  22. bytes of that data are unused, so the actual status data starts at offset $04 in
  23. the status buffer.
  24.  
  25. The LaserWriter printer returns its status data in the form of a Pascal string.
  26. That string is usually something suitable to display on the screen (e.g.,
  27. "status: idle" or "job: Fred; document: My LaserWriter is on fire; status: busy;
  28. source: AppleTalk").  In fact, the status text displayed in the Print Manager
  29. LaserWriter dialog boxes is usually the statusString returned by PAPStatus or
  30. PAPOpen.  Figure 1 shows the contents of the status buffer returned by a
  31. LaserWriter.
  32.  
  33.           +-------------------+
  34.      $00  |_                 _|    Longword       Unused
  35.           |_      unused     _|
  36.           |_                 _|
  37.           |                   |
  38.           +-------------------+
  39.      $04  |_ (string length) _|
  40.           |_                 _|
  41.           |_                 _|
  42.           .                   .
  43.           .   status string   .    String         The PAP status string
  44.           .                   .                   (Pascal string, ASCII,
  45.           |_                 _|                   high-bit clear)
  46.           |_                 _|
  47.           |                   |
  48.      $103 +-------------------+         
  49.           
  50.  
  51.                  Figure 1-PAP Status Buffer from a LaserWriter
  52.  
  53. The ImageWriter II/LQ LocalTalk Option card does not return a status string for
  54. display.  Instead, it returns a statusBits word where each bit within that word
  55. has a specific meaning.  Your application can interpret the statusBits word and
  56. generate an appropriate message to display.  Figure 2 shows the contents of the
  57. status buffer returned by the ImageWriter II/LQ LocalTalk Option card and the
  58. individual bit definitions of the statusBits word.
  59.  
  60.           +------------------+
  61.      $00  |_                _|     Longword       Unused
  62.           |_      unused    _|
  63.           |_                _|
  64.           |                  |
  65.           +------------------+
  66.      $04  |string data length|     Byte           Always = 2
  67.           +------------------+
  68.      $05  |_    statusBits  _|     Word           Status bits returned by
  69.           |                  |                    LocalTalk ImageWriter
  70.           +------------------+                    Option card (see following
  71.      $07  |_                _|                    definition)
  72.           |_                _|
  73.           |_                _|
  74.           .                  .     253 Bytes      Unused
  75.           .                  .
  76.           .                  .
  77.           |_                _|                    
  78.           |_                _|
  79.           |                  |
  80.      $103 +------------------+          
  81.      
  82.                             +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  83.                             |15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
  84.                             +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  85.                               |  |<-- Reserved --->|  |  |  |  |  |  |  |  |
  86. 1 = Printer is busy ----------+  |_________________|  |  |  |  |  |  |  |  |
  87.                                                       |  |  |  |  |  |  |  |
  88. 1 = Color ribbon installed ---------------------------+  |  |  |  |  |  |  |
  89. 1 = Sheet feeder installed ------------------------------+  |  |  |  |  |  |
  90. 1 = Paper out error ----------------------------------------+  |  |  |  |  |
  91. 1 = Cover open error ------------------------------------------+  |  |  |  |
  92. 1 = Printer off line ---------------------------------------------+  |  |  |
  93. 1 = Paper jam error -------------------------------------------------+  |  |
  94. 1 = Printer fault ------------------------------------------------------+  |
  95. 1 = Printer active (head is moving) ---------------------------------------+
  96.  
  97.  
  98.    Figure 2-PAP Status Buffer from an ImageWriter II/LQ LocalTalk Option Card
  99.  
  100. There are two additional things to note when interpreting the statusBits word
  101. returned by a ImageWriter II/LQ LocalTalk Option card:
  102.  
  103.   o   If a sheet feeder is installed (bit 6 = 1), running out of paper results
  104.       in a "Paper jam error" (bit 2 = 1) instead of a "Paper out error" (bit 5).
  105.   o   The ImageWriter  II/LQ LocalTalk Option card has been known to randomly
  106.       return all ones in the low byte (bits 0-7) of the statusBits word.  When
  107.       this happens, the statusBits word is invalid and an application should
  108.       repeat the PAPStatus call to get valid information.
  109.  
  110.  
  111. Further Reference
  112. _____________________________________________________________________________
  113.   o     Inside AppleTalk, Second Edition
  114.   o     AppleShare Programmer's Guide for the Apple II Family
  115.  
  116.